<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html ng-app="LeaderboardApp">
<head>
<meta charset="UTF-8">
<title>Administración de Bonos por Metas</title>
<link href="/Leaderboard/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="/Leaderboard/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css"/>
<link href="/Leaderboard/css/bootstrap-spinner.css" rel="stylesheet" type="text/css"/>
<link href="/Leaderboard/css/select2.css" rel="stylesheet" type="text/css"/>
<link href="/Leaderboard/css/select2-bootstrap.css" rel="stylesheet" type="text/css"/>
<link href="/Leaderboard/css/styles.css" rel="stylesheet" type="text/css"/>

<script type="text/javascript" src="/Leaderboard/js/lib/bootstrap/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="/Leaderboard/js/lib/bootstrap/respond.min.js"></script>
<script type="text/javascript" src="/Leaderboard/js/lib/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="/Leaderboard/js/lib/bootstrap/bootstrap3-typeahead.js"></script>
<script type="text/javascript" src="/Leaderboard/js/lib/bootstrap/jquery.spinner.min.js"></script>

<!--[if lt IE 9]><script type="text/javascript" src="/Leaderboard/js/lib/angularjs/html5shiv-printshiv.min.js"></script><![endif]-->
<!--[if lt IE 8]><script type="text/javascript" src="/Leaderboard/js/lib/angularjs/json3.min.js"></script><![endif]-->

<script type="text/javascript" src="/Leaderboard/js/lib/select2.min.js"></script>
<script type="text/javascript" src="/Leaderboard/js/lib/angularjs/angularjs-1.2.16.min.js"></script>
<script type="text/javascript" src="/Leaderboard/js/controllers.init.js"></script>
<script type="text/javascript" src="/Leaderboard/js/controllers.admin.js"></script>
<script type="text/javascript" src="/Leaderboard/js/controllers.bonosMetas.js"></script>

<!--[if lte IE 8]>
<script type="text/javascript">
    $(document).ready(function() {
        angular.bootstrap(document);
    });
</script>
<![endif]-->
</head>
<body>
	<div ng-include="'/Leaderboard/include/header.html'"></div>
	
	<div class="container">
		<div ng-include="'/Leaderboard/include/changePassword.html'"></div>
	
		<div ng-controller="bonosMetasCtrl">
			<div ng-include="'/Leaderboard/include/messages.html'"></div>
			<div class="panel panel-primary">
				<div class="panel-heading"><h3 class="panel-title">Administraci&oacute;n de Bonos por Cantidad de Metas Cumplidas</h3></div>
				<div class="panel-body panel-body-scrollable">
				
					<table class="table table-striped table-condensed table-bordered" ng-table="tableParams">
						<thead><tr><th>ID</th><th>Cantidad Metas</th><th >Puntos Bono</th><th colspan="2">Acciones</th></tr></thead>
						<tbody><tr ng-repeat="bono in bonosMetas | filter:bonoSearch">
							<td>{{bono.id}}</td><td>{{bono.cantidadMetas}}</td><td>{{bono.puntosBono}}</td>
							<td>
								<span>
									<a class="link float-left" href="javascript:void(0);" ng-click="openDialog('edit', bono)">Editar</a>
									&nbsp;
									<a class="link float-left" href="javascript:void(0);" ng-click="delBono(bono.id)">Borrar</a>
								</span>
							</td>
						</tr></tbody>
					</table>

				</div>
				<div class="panel-footer">
					<input id="bonoSearch" name="bonoSearch" class="form-control search-box" ng-model="bonoSearch" placeholder="Escriba el texto a buscar" />
					<button type="button" class="btn btn-default" ng-click="getBonosMetas()">Refrescar</button>
					<button type="button" class="btn btn-primary" ng-click="openDialog('add', null)">Agregar nueva</button>
				</div>
			</div>
	
			<div class="modal fade" id="dlgAddEdit" role="dialog" aria-labelledby="dlgAddEdit" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<form id="addForm" name="addForm" class="form-horizontal" role="form">
							<div class="modal-header">
								<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
								<h4 class="modal-title">Agregar/Editar Configuración de Bonos por Metas</h4>
							</div>
							<div class="modal-body">
								<div ng-include="'/Leaderboard/include/modalMessages.html'"></div>
								<div class="form-group">
									<label for="txtUsuario" class="col-sm-4 control-label">Cantidad metas</label>
									<div class="col-sm-8 input-append spinner" data-trigger="spinner">
										<input id="txtCantMetas" name="cantMetas" class="form-control" type="text" maxlength="4" width="4" 
												ng-model="addData.cantidadMetas" autofocus required ng-disabled="loading || editMode" data-rule="quantity" autofocus />
									</div>
								</div>
								<div class="form-group">
									<label for="txtPuntosBono" class="col-sm-4 control-label">Puntos por Bono</label>
									<div class="col-sm-8 input-append spinner" data-trigger="spinner">
										<input id="txtPuntosBono" name="ponderacion" class="form-control" type="text" maxlength="4" width="4" 
												ng-model="addData.puntosBono" required ng-disabled="loading" data-rule="quantity" />
									</div>
								</div>
							</div>
							 <div class="modal-footer">
								<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
								<button type="submit" class="btn btn-primary" ng-click="saveBono()" ng-disabled="loading || addForm.$invalid">Guardar cambios</button>
							</div>
						</form>
					</div>
				</div>
			</div>
			
		</div>
	</div>
</body>
</html>